package name.fowler.refactoring.simplestore;

class StoreReport {
	public void report(Store store, Formatter fmt) {
		fmt.header("Full store statement");
		double totalAmount = 0;
		for (Customer cust: store.getCustomers()) {
			double eachAmount = cust.bill();
			totalAmount += eachAmount;
			fmt.println( cust.getName() + " owes " + eachAmount);
		}
		fmt.footer("Total amount for store: " + totalAmount);
	}
}
